﻿Imports System.Xml
Imports System.IO
Public Class Config
    Public Shared TABLE_SCHEMA As String = ""
    Public Shared SERVER As String = ""
    Public Shared PORT As String = ""
    Public Shared Uid As String = ""
    Public Shared Pwd As String = ""

    Public Shared Function loadConfig() As Boolean
        Dim xmldoc As New XmlDataDocument()
        Dim xmlnode As XmlNodeList
        Dim i As Integer
        Dim fs As New FileStream("D:\Programming\VB.NET\Project\dvv-vb-project\QuanLyTaiSanCoDinh\Config.xml", FileMode.Open, FileAccess.Read)
        xmldoc.Load(fs)
        xmlnode = xmldoc.GetElementsByTagName("Config")
        For i = 0 To xmlnode.Count - 1
            Config.TABLE_SCHEMA = xmlnode(i).ChildNodes.Item(0).InnerText.Trim()
            Config.SERVER = xmlnode(i).ChildNodes.Item(1).InnerText.Trim()
            Config.PORT = xmlnode(i).ChildNodes.Item(2).InnerText.Trim()
            Config.Uid = xmlnode(i).ChildNodes.Item(3).InnerText.Trim()
            Config.Pwd = xmlnode(i).ChildNodes.Item(4).InnerText.Trim()
        Next
    End Function
End Class
